package com.seawaterbt.ssm.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seawaterbt.ssm.config.DataSource;
import com.seawaterbt.ssm.config.DataSourceEnum;
import com.seawaterbt.ssm.entity.CzBasCrew;
import com.seawaterbt.ssm.entity.CzBasHeatstation;
import com.seawaterbt.ssm.entity.CzDatCrewData;
import com.seawaterbt.ssm.mapper.CzBasCrewMapper;
import com.seawaterbt.ssm.service.CzBasCrewService;
import com.seawaterbt.ssm.service.CzDatCrewdataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class CzBasCrewServiceImpl extends ServiceImpl<CzBasCrewMapper, CzBasCrew> implements CzBasCrewService {

    @Autowired
    CzDatCrewdataService czDatCrewdataService;

    @DataSource(DataSourceEnum.DB2)
    @Override
    public CzBasCrew listOne(String code) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("code",code);
        return this.getOne(wrapper);
    }
    @DataSource(DataSourceEnum.DB2)
    @Override
    public CzBasCrew GetOneByProviencecode(String provinceCode) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("code_province",provinceCode);
        return this.getOne(wrapper);
    }

    @DataSource(DataSourceEnum.DB2)
    @Override
    public List<CzBasCrew> list(Wrapper<CzBasCrew> queryWrapper) {
        return super.list(queryWrapper);
    }
}
